package com.lifeverse.entity.enums;

/**
 * 规则优先级枚举
 * 定义规则的执行优先级
 */
public enum RulePriority {
    
    /**
     * 低优先级
     */
    LOW(1, "低", "低优先级规则，在其他规则执行后执行"),
    
    /**
     * 普通优先级
     */
    NORMAL(5, "普通", "普通优先级规则，按顺序执行"),
    
    /**
     * 高优先级
     */
    HIGH(10, "高", "高优先级规则，优先执行"),
    
    /**
     * 紧急优先级
     */
    URGENT(20, "紧急", "紧急优先级规则，立即执行"),
    
    /**
     * 关键优先级
     */
    CRITICAL(50, "关键", "关键优先级规则，最高优先级执行");
    
    private final int level;
    private final String displayName;
    private final String description;
    
    RulePriority(int level, String displayName, String description) {
        this.level = level;
        this.displayName = displayName;
        this.description = description;
    }
    
    public int getLevel() {
        return level;
    }
    
    public String getDisplayName() {
        return displayName;
    }
    
    public String getDescription() {
        return description;
    }
    
    /**
     * 比较优先级
     */
    public boolean isHigherThan(RulePriority other) {
        return this.level > other.level;
    }
    
    /**
     * 比较优先级
     */
    public boolean isLowerThan(RulePriority other) {
        return this.level < other.level;
    }
}